<template>
    <div>
        <!-- 背景盒子 -->
        <div class="bj_box">
            <div class="left_fanhui">
                <i class="iconfont icon-fanhui"></i>
                <p>密码登录</p>
            </div>
            <div class="login_big">
                <!-- 两个输入框 -->
                <div class="content">
                    <div class="content_box">
                        <input type="text" v-model="form.username" placeholder="请输入手机号">
                    </div>
                    <div class="content_box">
                        <input type="text" v-model="form.password" placeholder="请输入验证码">
                        <div class="pass">获取验证码</div>
                    </div>
                </div>
                <!-- 登录 -->
                <div class="denglu" @click="login">登录</div>
                <!-- 选项 -->
                <div class="choose">
                    <input type="checkbox">
                    <p>我已阅读并同意 《乐康养老用户协议》《隐私政策》</p>
                </div>
                <!-- 忘记密码 -->
                <div class="forget">
                    <p>忘记密码</p>
                </div>
            </div>
        </div>
    </div>
</template>
<style>
@import url(../assets/css/lekang.css);
@import url(../assets/iconfont/iconfont.css);
</style>
<script>


export default {
    name: 'HomeView',
    data() {
        return {
            form: {
                username: '',
                password: ''
            }
        }
    },
    methods: {
        login() {
            if (!this.form.username) {
                alert('请输入手机号');
                return;
            }

            if (!this.form.password) {
                alert('请输入密码');
                return;
            }
            // console.log(this.form)
            this.$store.dispatch('loginAsync', this.form)
        }
    }


}
</script>